<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--<link rel="stylesheet" href="css/bootstrap.min.css">-->
</head>
<style>
    .red{
        background-color: red;
    }
</style>
<body>
<!--<div class="red">test页面</div>-->

<video style="width: 90%;height: 90%" autoplay="autoplay" loop="loop" muted="muted">
    <source src="video/miku1314.mp4">
</video>

<div style="color: white;position: absolute;top: 80px;right: 50px">
    日期:<span id="date_span"></span><br>
    城市:<span id="cityname_span"></span><br>
    天气:<span id="weather_span"></span><br>
    温度:<span id="temperature_span"></span><br>
</div>

<script>
    //    天气
    $(function () {
        $.ajax({
            type:"post",
            url:"weatherServlet",
            dataType:"json",
            success:function (data) {
                // alert(data);
                // var lis = '';
                $("#date_span").html(data.date);
                $("#cityname_span").html(data.cityname);
                $("#weather_span").html(data.weather);
                $("#temperature_span").html(data.temperature);
            }
        })
    })
    //下载
    $("#down_data").click(function (){
        $.ajax({
            type: "post",
            dataType: "json",
            url: "user/downLoad",
            success:function (data){
                if (data.flag == true){
                    alert("导出数据成功！");
                }else if (data.flag == false){
                    alert("信息导出失败！");
                }else {
                    alert("服务器错误！")
                }
            }
        })
    })
    //上传
    $("#up_data").click(function (){
        $.ajax({
            type: "post",
            dataType: "json",
            url: "user/upLoad",
            success:function (data){
                if (data.flag == true){
                    alert("上传数据成功！");
                }else if (data.flag == false){
                    alert("上传数据失败！");
                }else {
                    alert("服务器错误！")
                }
            }
        })
    })


</script>

<div style="width:100%;height:90%;position: absolute;top:50px;color: red;">
    <div style="position: absolute;right: 20px;bottom: 0;">
        <button id="down_data" type="button" class="btn btn-primary btn-lg">下载</button>
        <button id="up_data" type="button" class="btn btn-default btn-lg">上传</button>
    </div>
</div>
</body>
</html>